const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
const path = require('path');
const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;
module.exports = function override(config, env) {
  config.plugins.push(
    new MonacoWebpackPlugin({
      languages: ['javascript', 'json', 'typescript'],
    }),
    new BundleAnalyzerPlugin({
      analyzerMode: 'server',
      analyzerHost: '127.0.0.1',
      analyzerPort: 8888,
      openAnalyzer: true, // 构建完打开浏览器
      reportFilename: path.resolve(__dirname, `analyzer/index.html`),
    })
  );
  return config;
};
